package com.example.demo.service.impl;

import com.example.demo.entity.CourseComment;
import com.example.demo.mapper.CourseCommentMapper;
import com.example.demo.service.CourseCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseCommentServiceImpl implements CourseCommentService {

    @Autowired
    private CourseCommentMapper courseCommentMapper;

    @Override
    public int insertCourseComment(CourseComment courseComment) {
        return courseCommentMapper.insertCourseComment(courseComment);
    }

    @Override
    public int deleteCourseCommentById(int id) {
        return courseCommentMapper.deleteCourseCommentById(id);
    }

    @Override
    public int updateCourseComment(CourseComment courseComment) {
        return courseCommentMapper.updateCourseComment(courseComment);
    }

    @Override
    public CourseComment selectCourseCommentById(int id) {
        return courseCommentMapper.selectCourseCommentById(id);
    }

    @Override
    public List<CourseComment> selectAllCourseComments() {
        return courseCommentMapper.selectAllCourseComments();
    }

    @Override
    public List<CourseComment> selectCourseCommentsByCourseId(int courseId) {
        return courseCommentMapper.selectCourseCommentsByCourseId(courseId);
    }
}